Skip to content

fix: better coverage for distant bins#5521

Open
sbackend123 wants to merge 3 commits into
feat/gossip-improvementsfrom
fix/better-coverage
Open

fix: better coverage for distant bins#5521
sbackend123 wants to merge 3 commits into
feat/gossip-improvementsfrom
fix/better-coverage

Conversation

@sbackend123

Copy link
Copy Markdown
Contributor

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

Description

Increased defaultBroadcastBinSize from 2 to 6. During Announce(), this raises the number of peers randomly selected per bin for gossip in both directions: existing peers notified about the newcomer, and existing peers shared with the newcomer.

related to PR #5520

Open API Spec Version Changes (if applicable)

Motivation and Context (Optional)

Related Issue (Optional)

Screenshots (if appropriate):

AI Disclosure

  • This PR contains code that has been generated by an LLM.
  • I have reviewed the AI generated code thoroughly.
  • I possess the technical expertise to responsibly review the code generated in this PR.

@sbackend123
sbackend123 marked this pull request as ready for review June 29, 2026 13:09
Comment on lines +1045 to +1050
if isNeighbor {
k.metrics.AnnounceIsNeighborTotal.WithLabelValues("true").Inc()
} else {
k.metrics.AnnounceIsNeighborTotal.WithLabelValues("false").Inc()
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe simplify code to 1 line by using strconv.FormatBool(isNeighbor)

Namespace: m.Namespace,
Subsystem: subsystem,
Name: "announce_errors_total",
Help: "Number of announce errors. The reason label is one of: random_subset, broadcast_to_new.",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe to add broadcast_to_existing, when calling BroadcastPeers async to existing peers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants